# Version 0.1

FROM centos:7

LABEL maintainer="shihd@fastmail.com"

RUN mkdir oracle_install && cd oracle_install 

ADD ./oracle_install/ ./oracle_install/

RUN if [ ! -f "/oracle_install/oracle-database-xe-18c-1.0-1.x86_64.rpm" ]; then \
    yum install -y wget && wget https://download.oracle.com/otn-pub/otn_software/db-express/oracle-database-xe-18c-1.0-1.x86_64.rpm; \
    else echo 'file exist'; fi \
 && curl -o /oracle_install/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm \
 && yum -y localinstall /oracle_install/oracle-database*18c*.rpm \
 && sed -i -e 's/^\(oracle   hard   memlock\)/#\1/' /etc/security/limits.d/oracle-database-preinstall-18c.conf \
 && rm /oracle_install/*.rpm \
 && (echo "oracle"; echo "oracle";) | /etc/init.d/oracle-xe-18c configure \
 && export ORACLE_SID=XE && export ORAENV_ASK=NO && . /opt/oracle/product/18c/dbhomeXE/bin/oraenv


